package com.novelastudios.events
{
	import flash.events.Event;
	
	/**
	 * 
	 * @author JohnBailey, NovelaStudios ©2008
	 * 
	 */	
	public class ListIndexEvent extends GenericEvent
	{
		public static const INDEX_ERROR:String 			= "ListIndexEvent.INDEX_ERROR";
		public static const INDEX_CHANGE:String 		= "ListIndexEvent.INDEX_CHANGE"; 
		public static const INDEX_AT_END:String 		= "ListIndexEvent.INDEX_AT_END";
		public static const INDEX_AT_BEGINNING:String 	= "ListIndexEvent.INDEX_AT_BEGINNING";
		
		public function ListIndexEvent(type:String, oldIndex:int, newIndex:int, data:Object=null, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, data, bubbles, cancelable);
			_oldIndex = oldIndex;
			_newIndex = newIndex;
		}
		
		///////////////////////////////
		//-------------------------
		//	oldIndex
		//-------------------------
		private var _oldIndex:int;
		public function get oldIndex():int
		{
			return _oldIndex;
		}
		
		///////////////////////////////
		//-------------------------
		//	newIndex
		//-------------------------
		private var _newIndex:int;
		public function get newIndex():int
		{
			return _newIndex;
		}
		
		/**
		 * 
		 * @return 
		 * 
		 */		
		override public function toString():String 
		{
			return formatToString("ListIndexEvent", "type", "oldIndex", "newIndex", "data", "bubbles", "cancelable");
		}
		
		/**
		 * @description  Returns a copy of the event instance.
		 *
		 * @returns  A copy of the event.
		 */
		override public function clone():Event
		{
			return new ListIndexEvent(type,oldIndex, newIndex,data,bubbles,cancelable);	
		}
	}
}